package org.demo.controller;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloAction implements Controller {


    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {

        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("hello", "欢迎1@");
        modelAndView.setViewName("/WEB-INF/jsp/index.jsp");
        modelAndView.setViewName("index");

        httpServletResponse.setCharacterEncoding("UTF-8");

        return modelAndView;
    }
}
